Skip to content

Add <!doctype html> to the to_html template - #5693

Merged
emilykl merged 6 commits into
mainfrom
mishrakushal-add-doctype-to_html
Aug 7, 2026
Merged

Add <!doctype html> to the to_html template#5693
emilykl merged 6 commits into
mainfrom
mishrakushal-add-doctype-to_html

Conversation

@emilykl

@emilykl emilykl commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Link to issue

Closes #4847

Continuation of PR #4848 by @mishrakushal

Description of change

Add <!doctype html> at top of HTML template for compliance with modern web standards.

Demo

n/a

Testing strategy

Call fig.to_html() and verify that the generated HTML file has <!doctype html> at the very top.

Additional information (optional)

Updated unit tests accordingly.

Note: Adding <!doctype html> changed the chart rendering behaviour and made charts render at 450px high rather than filling the browser window. To keep the existing behaviour, this PR adds a small HTML snippet to the template:

<style>html, body {{height: 100%;}}</style>

Guidelines

@emilykl
emilykl force-pushed the mishrakushal-add-doctype-to_html branch from 473f83a to 2e67205 Compare August 6, 2026 22:38
@emilykl
emilykl requested a review from camdecoster August 6, 2026 22:42
camdecoster
camdecoster previously approved these changes Aug 6, 2026

@camdecoster camdecoster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏄

@emilykl
emilykl force-pushed the mishrakushal-add-doctype-to_html branch from 2e67205 to 0d0e641 Compare August 6, 2026 23:33
@emilykl
emilykl force-pushed the mishrakushal-add-doctype-to_html branch from 0d0e641 to 3cec990 Compare August 7, 2026 00:00
@emilykl
emilykl merged commit 33892af into main Aug 7, 2026
25 checks passed
@emilykl
emilykl deleted the mishrakushal-add-doctype-to_html branch August 7, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow (or switch to) generating html that starts with <!doctype html> when using to_html(full_html=True)

2 participants